#include<iostream>
#include <signal.h>
#include <unistd.h>

void handler(int signo)
{
  std::cout<<"get a signo: "<<signo<<std::endl;
}

int main()
{
  std::cout<<"my pid :"<<getpid()<<std::endl;
  signal(2,handler);
  while(true)
  {
    std::cout<<"I running...."<<std::endl;
    sleep(1);
  }
  return 0;
}
